﻿@model VoiceAd.Models.tblCampaign
@{
    ViewBag.Title = "Campaign";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<div class="clear dvHeight20">
</div>
<div class="dvTitleBook">
    Chiến dịch @Model.Title
</div>
<div class="dvArrActive">
    <div class="dvColCampName">
        chiến dịch
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        ngày bắt đầu
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        ngày kết thúc
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        Số đài
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColFileMp3">
        file
    </div>
</div>
<div class="dv960">
    <div class="dvWidth215 dvTextCenter" style="font-weight: bold;">
        @Model.Title
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175 dvTextCenter" style="font-weight: bold;">
        @Model.BeginDay.Value.ToString("dd/MM/yyyy")
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175 dvTextCenter" style="font-weight: bold;">
        @Model.EndDay.Value.ToString("dd/MM/yyyy")
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175 dvTextCenter" style="font-weight: bold;">
        @{
            VoiceAd.DAL.ICampaignRepository db = new VoiceAd.DAL.CampaignRepository(new VoiceAd.Models.dbVoiceAdDataContext());
            int intCount = db.GetSumStation(Model.Id);
       
        }
        @intCount
    </div>
    <div class="dvWidth200 dvTextCenter">
        @{
            int strIdVoice = 0;
            string idPlayerVoice = "IdPlayerVoice";
        }
        @foreach (VoiceAd.Models.tblAudioCamp objAudio in ViewBag.lstAudio)
        {
            idPlayerVoice = idPlayerVoice + strIdVoice.ToString();
           
            <div id="@idPlayerVoice">
            </div>
            <script type="text/javascript">
                jwplayer("@idPlayerVoice").setup({
                    modes: [{ type: 'html5' }, { type: 'flash', src: 'jwplayer.flash.swf'}],
                    file: '@Url.Content("~/uploads/Customer/" + @objAudio.UrlAudio)',
                    autostart: 'false',
                    type: 'mp3',
                    width: '200',
                    height: '30'
                });
            </script>
            strIdVoice++;
        }
    </div>
    <div class="dvWidth5">
    </div>
</div>
<div class="clear" style="padding-top: 25px;">
    &nbsp;
</div>
<div class="dvTitleBook">
    Thông tin chiến dịch
</div>
<div class="dvArrActive">
    <div class="dvColNgay">
        Tỉnh thành
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        Quận huyện
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay" style="width: 200px;">
        Số ngày upload file monitor
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        &nbsp;
    </div>
</div>
<div class="clear">
</div>
<div class="dvBoxStation" style="position: relative; margin-top: 10px; border: 0 none !important;">
    @foreach (VoiceAd.Models.tblDistrictProvince tbl in ViewBag.lstDistrictCampaign)
    {    
        <div class="dvWidth5">
        </div>
        <div class="dvWidth215 textGrv">
            @tbl.ProvinceName
        </div>
        <div class="dvWidth5">
        </div>
        <div class="dvWidth215 textGrv">
            @tbl.DistrictName
        </div>
        <div class="dvWidth5">
        </div>
        <div class="dvWidth215 textGrv">
            @{
                int soNgay = 0;
                VoiceAd.DAL.IBlockRepository blockRepository = new VoiceAd.DAL.BlockRepository(new VoiceAd.Models.dbVoiceAdDataContext());
                soNgay = blockRepository.SumDayByBookingId(Convert.ToInt32(tbl.BookingId));
            }
            @tbl.SoFileMoniTor/@soNgay
        </div>
        <div class="dvWidth5">
        </div>
        <div class="dvWidth215 textGrv">
            @Html.ActionLink("Xem file monitor", "CampaignDetail", new { id = tbl.BookingId })
        </div>        
    }
</div>
